

module.exports = {
    /*
     ** Headers of the page
     */
    server: {
		localhost: '127.0.0.1',
        port: '2000'
    },
    head: {
        title: '专利服务系统',
        meta: [{
                charset: 'utf-8'
            },
            {
                name: 'viewport',
                content: 'width=device-width, initial-scale=1'
            },
            {
                hid: 'description',
                name: 'description',
                content: 'Nuxt.js project'
            },
			//默认使用极速模式
            {
                name:'renderer',
                content:'webkit'
            }
        ],
        link: [{
            rel: 'icon',
            type: 'image/x-icon',
            href: '/'
        }]
    },
    render: {
        resourceHints: false,
    },
    /*
     ** Customize the progress bar color
     */
    loading: {
        color: '#3B8070'
    },
    /*
     ** Build configuration
     */
    css: [{
        src: 'element-ui/lib/theme-chalk/index.css'
    }, {
        src: 'iview/dist/styles/iview.css'
    }, {
        src: '~assets/styles/border.css'
    }, {
        src: '~assets/styles/iconfont.css'
    }],
    //插件：类似vue-cli的main.js拆分了引入
    plugins: [{
        src: '~plugins/babel-polyfill',
        ssr: true
    }, {
        src: "~plugins/axios",
        ssr: true
    }, {
        src: "~plugins/cookie",
        ssr: false
    }, {
        src: '~plugins/ui',
        ssr: true
    }, {
        src: '~plugins/baseurl',
        ssr: false
    }, '~plugins/echarts'],
    //模块：在context和this都可以使用，属性名称为$axios
    modules: [
        '@nuxtjs/axios'
    ],
    // 路由配置/中间件：所有路由的vue组件都引用这个中间件
    router: {
        middleware: ['userAuth', 'borwser'],
        prefetchLinks: false//禁止js预加载
    },
    // preformance: {
    //   prefetch: false
    // },
    build: {
        /*
         ** Run ESLint on save
         */
        extend(config, {
            isDev,
            isClient
        }) {
            if (isDev && isClient) {
                // config.module.rules.push({
                // 	enforce: 'pre',
                // 	test: /\.(js|vue)$/,
                // 	loader: 'eslint-loader',
                // 	exclude: /(node_modules)/
                // })
            }
        },
        // optimization:{},
        // extractCSS: true
    }
}
